home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
windows
/
pcbrd.zip
/
PCBLOGON.WAS
next >
Wrap
Text File
|
1992-06-27
|
5KB
|
208 lines
; Script to log on to a BBS running PCBoard.
;*************************************************************************
;***
;*** module : pcblogon.was
;***
;*** program : ProComm Plus for Windows
;***
;*** target system : IBM-PC or compatible running Microsoft Windows
;*** 3.0 or later, and ProComm Plus for Windows 1.0
;*** or later.
;***
;*** purpose : script to log on to a BBS running PCBoard.
;*** assumes that script is linked to entry in dialing
;*** directory.
;***
;*** notes : Copyright (c) 1992, Jeff Thomson
;*** All rights reserved.
;***
;*** language : Windows ASPECT
;***
;*** version : $Author: jkt $
;*** control $Date: 92/06/24 21:47:04 $
;*** $Revision: 1.0 $
;*** $State: Exp $
;*** $Source: c:/comm/prowin/aspect/rcs/pcblogon.was $
;*** $Log: pcblogon.was $
;*** Revision 1.0 92/06/24 21:47:04 jkt
;*** Place under version control.
;***
;***
;*** history :
;***
;*** date authors comments
;***
;*** 14jun1992 jeff thomson new code; ported from pcboard.slt.
;*** 15jun1992 jeff thomson fixed bug w/ handling multiple
;*** question marks in prompts.
;*** 27jun1992 jeff thomson add copyright notice.
;***
;*************************************************************************
integer bExitFlag ; flag indicating that it's time
; to exit main.
proc main
bExitFlag = 0 ; initialize exit flag.
when target 0 "?" call getprompt ; wait for "?" indicating prompt.
while ( $CARRIER == 0 ) ; wait for CD to be asserted.
endwhile
;***
;*** sit & spin while the events happen.
;***
while ( $CARRIER ) && ( bExitFlag == 0 )
endwhile
clearwhen target 0
endproc
;*************************************************************************
;***
;*** function : getprompt
;***
;*** purpose : determines which prompt occurred and issues
;*** appropriate response.
;***
;*** sample call : when target 0 "?" call getprompt
;***
;*** inputs : none.
;***
;*** returns : none.
;***
;*** notes : none.
;***
;*************************************************************************
proc getprompt
string szPrompt ; buffer for line containing
; prompt.
integer nBegin ; offset of beginning of keyword.
integer nEnd ; offset of end of keyword.
integer cQCount ; number of ?s found in prompt.
termgets $ROW 0 szPrompt $COL ; read line w/ prompt from screen
;***
;*** since there is a possibility of there being more than one
;*** question mark in a prompt, extract the portion of the string
;*** containing the last question mark (since it contains the
;*** keyword of interest to us).
;***
strsearch szPrompt "?" cQCount ; find how many ?s there are.
while cQCount > 1
strfind szPrompt "?" nEnd ; find end of keyword.
nEnd = nEnd + 1
substr szPrompt szPrompt nEnd $COL
cQCount = cQCount - 1
endwhile
strfind szPrompt "?" nEnd ; find end of keyword.
substr szPrompt szPrompt 0 nEnd ; strip everything after "?"
;***
;*** grab the last token in the string.
;***
nBegin = 0
while strfind szPrompt " " nBegin ; find next space
nBegin = nBegin + 1
substr szPrompt szPrompt nBegin nEnd ; grab everything after space
endwhile
;***
;*** decide what to do...
;***
switch szPrompt
case "change" ; "Enter Language # to use (Enter)=no change?"
transmit "^M"
endcase
case "(Enter)=no" ; "Do you want color graphics (Enter)=no?"
transmit "n^M"
endcase
case "No" ; "Do you want Color? Y=Yes, N or Enter = No?"
transmit "n^M"
endcase
case "name" ; "What is your first name?"
; "Enter your first name?"
transmit $USERID
transmit "^M"
endcase
case "echo)" ; "Password (Dots will echo)?"
transmit $PASSWORD
transmit "^M"
endcase
case "More" ; "(H)elp, More?"
transmit "n^M"
endcase
case "(Enter)=More" ; "Help, NS, N=Stop, (Enter)=More?"
transmit "n^M"
endcase
case "continue" ; "Press (Enter) to continue?"
transmit "^M"
endcase
case "(Enter)=yes" ; "Scan message Base Since 'Last Read' (Enter)=yes?"
transmit "n^M"
endcase
case "Yes" ; "Scan Message Base Since 'Last Read'? N=No, Enter = Yes?"
transmit "n^M"
endcase
case "Command" ; "Main Board Command?"
; "Channel 1 Command?"
bExitFlag = 1
endcase
endswitch
endproc
;***
;*** end of pcblogon.was
;***